<?php
class GameTO {
        private $id = '';
	private $league   = '';
	private $homeTeam   = '';
	private $awayTeam   = '';
	private $percentFix1 = '';
	private $percentFixX = '';
	private $percentFix2 = '';
	private $tip= '';
	private $odds1= '';
	private $oddsX= '';
	private $odds2= '';
	private $score1= '';
	private $score2 = '';
	private $under = '';
	private $over = '';
	private $result = '';
	private $dateFromPage = '';
	private $rowNo = '';
	private $timestamp = '';

        /*----------------------------------------------------------------        
         dobijaju se iz timestamp-a i ne posoje u toString() ili toArray()*/
        private $date = ''; 
        private $time = '';
        /*----------------------------------------------------------------*/
        
	function __construct(){
	}

        public function getId(){
            return $this->id;
        }
        public function setId($id){
            $this->id = $id;
        }

        public function getLeague(){
            return $this->league;
        }
        public function setLeague($league){
            $this->league = $league;
        }

        public function getHomeTeam(){
            return $this->homeTeam;
        }
        public function setHomeTeam($homeTeam){
            $this->homeTeam = $homeTeam;
        }

        public function getAwayTeam(){
            return $this->awayTeam;
        }
        public function setAwayTeam($awayTeam){
            $this->awayTeam = $awayTeam;
        }

        public function getPercentFix1(){
            return $this->percentFix1;
        }
        public function setPercentFix1($percentFix1){
            $this->percentFix1 = $percentFix1;
        }

        public function getPercentFixX(){
            return $this->percentFixX;
        }
        public function setPercentFixX($percentFixX){
            $this->percentFixX = $percentFixX;
        }

        public function getPercentFix2(){
            return $this->percentFix2;
        }
        public function setPercentFix2($percentFix2){
            $this->percentFix2 = $percentFix2;
        }

        public function getTip(){
            return $this->tip;
        }
        public function setTip($tip){
            $this->tip = $tip;
        }

        public function getOdds1(){
            return $this->odds1;
        }
        public function setOdds1($odds1){
            $this->odds1 = $odds1;
        }

        public function getOddsX(){
            return $this->oddsX;
        }
        public function setOddsX($oddsX){
            $this->oddsX = $oddsX;
        }

        public function getOdds2(){
            return $this->odds2;
        }
        public function setOdds2($odds2){
            $this->odds2 = $odds2;
        }

        public function getScore1(){
            return $this->score1;
        }
        public function setScore1($score1){
            $this->score1 = $score1;
        }

        public function getScore2(){
            return $this->score2;
        }
        public function setScore2($score2){
            $this->score2 = $score2;
        }

        public function getUnder(){
            return $this->under;
        }
        public function setUnder($under){
            $this->under = $under;
        }

        public function getOver(){
            return $this->over;
        }
        public function setOver($over){
            $this->over = $over;
        }

        public function getResult(){
            return $this->result;
        }
        public function setResult($result){
            $this->result = $result;
        }

        public function getDateFromPage(){
            return $this->dateFromPage;
        }
        public function setDateFromPage($dateFromPage){
            $this->dateFromPage = $dateFromPage;
        }

        public function getRowNo(){
            return $this->rowNo;
        }
        public function setRowNo($rowNo){
            $this->rowNo = $rowNo;
        }     
        public function getTimestamp(){
        	return $this->timestamp;
        }
        public function setTimestamp($timestamp){
        	$this->timestamp = $timestamp;
        }

        public function toArray(){
            $data = array(
                'id' => $this->getId(),
                'league' => $this->getLeague(),
                'homeTeam' => $this->getHomeTeam(),
                'awayTeam' => $this->getAwayTeam(),
                'percentFix1' => $this->getPercentFix1(),
                'percentFixX' => $this->getPercentFixX(),
                'percentFix2' => $this->getPercentFix2(),
                'tip'=> $this->getTip(),
                'odds1'=> $this->getOdds1(),
                'oddsX'=> $this->getOddsX(),
                'odds2'=> $this->getOdds2(),
                'score1'=> $this->getScore1(),
                'score2' => $this->getScore2(),
                'under' => $this->getUnder(),
                'over' => $this->getOver(),
                'result' => $this->getResult(),
                'dateFromPage' => $this->getDateFromPage(),
                //'rowNo' => $this->getRowNo(),
                'timestamp' => $this->getTimestamp()
            );
            return $data;
        }

        public function toString(){
            return 'Game(id: '.$this->id.
                    '; league: '.$this->league.
                    '; homeTeam: '.$this->homeTeam.
                    '; awayTeam: '.$this->awayTeam.
                    ';percentFix1: '.$this->percentFix1.
                    ';percentFixX: '.$this->percentFixX.
                    ';percentFix2: '.$this->percentFix2.
                    ';tip: '.$this->tip.
                    ';odds1: '.$this->odds1.
                    ';oddsX: '.$this->oddsX.
                    ';odds2: '.$this->odds2.
                    ';score1: '.$this->score1.
                    ';score2: '.$this->score2.
                    ';under: '.$this->under.
                    ';over: '.$this->over.
                    ';result: '.$this->result.
                    ';dateFromPage: '.$this->dateFromPage.
                    //';rowNo: '.$this->rowNo.
                    ';timestamp: '.$this->timestamp.')';
                    
        }
        
        public function setDate(){
            if($this->timestamp != '') {
                list($year, $month, $day, $hour, $min, $sec) = preg_split('/[: -]/', $this->timestamp);
                $this->date = $day . '.' . $month . '.' . $year;
            }
        }
        public function getDate(){
            return $this->date;
        }
        public function setTime(){
            if($this->timestamp != '') {
                list($year, $month, $day, $hour, $min, $sec) = preg_split('/[: -]/', $this->timestamp);
                $this->time = $hour . ':' . $min;
            }
        }
        public function getTime(){
            return $this->time;
        }
}
?>